# Maintainer: Andrew Crerar <crerar@archlinux.org>
# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor: Douglas Soares de Andrade <dsa@aur.archlinux.org>

pkgname=python-psycopg2
pkgver=2.9.6
pkgrel=2
pkgdesc="A PostgreSQL database adapter for the Python programming language."
arch=('loong64' 'x86_64')
url="https://www.psycopg.org/"
license=('LGPL3')
depends=('python' 'postgresql-libs')
makedepends=('python-setuptools' 'postgresql-libs')
source=("https://github.com/psycopg/psycopg2/archive/refs/tags/${pkgver}.tar.gz")
b2sums=('9b3e1ddb6c23973e7577b27a46599c731edd77bd7017c25f3c5a1d57f89faffe066e5926b3ba4b7f1c7ab3b1ad18966b0f5ee40ceb1b358236cb85fb61d230ce')
build(){
  cd "psycopg2-${pkgver}"
  sed -i 's/,PSYCOPG_DEBUG$//' setup.cfg
  python setup.py build
}

package() {
  cd "psycopg2-${pkgver}"
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
}
